package com.tanhua.server.controller;

import com.tanhua.model.vo.PageResult;
import com.tanhua.server.service.FriendsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/users")
public class FriendsController {

    @Autowired
    private FriendsService friendsService;
    /**
     * 互相喜欢，喜欢，粉丝，谁看过我，翻页列表
     */
    @GetMapping("/friends/ {type}")
    public ResponseEntity statusList(@PathVariable("type") Integer type,
                                     @RequestParam(defaultValue = "1") Integer page,
                                     @RequestParam(defaultValue = "10")Integer pagesize,
                                     String nickname){
        PageResult pr = friendsService.statusList(type,page,pagesize,nickname);
        return ResponseEntity.ok(pr);
    }
}
